<template>
  <!-- 回访历史 -->
  <div>
    <LazyLoadTab v-model="activeName" :tabMenus="menus"></LazyLoadTab>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <el-button v-if="activeName === '回访历史'" type="primary" icon="el-icon-download" :loading="exportLoading" @click="returnExport">导出</el-button>
      <el-button @click="closeDialog">取 消</el-button>
    </div>
  </div>
</template>

<script>
import { getExcelList } from '@/api/customerRepair/customerLoss/taskEntry';
import { exportExcelFile } from '@/utils/index';
export default {
  name: 'returnHisModel',
  components: {},
  props: {
    getdata: Array
  },
  data() {
    return {
      exportLoading: false,
      activeName: '回访历史',
      menus: this.createdMenus()
    };
  },
  computed: {},
  watch: {},
  created() { },
  mounted() { },
  methods: {
    // 回访历史导出
    returnExport() {
      this.exportLoading = true;
      let data = this.getdata[0]
      // debugger
      let fetchParams = { VIN: this.getdata[0].VIN }
      return
      getExcelList(fetchParams).then(res => {
        exportExcelFile(res, '回访历史');
        this.exportLoading = false;
      });
    },
    createdMenus() {
      return [
        {
          title: '回访历史',
          path: 'customerRepair/customerLoss/taskEntry/returnInfo/returnHistory',
          params: {
            getdata: this.getdata
          }
        },
        {
          title: '销售回访 DCRC回访信息 ',
          path: 'customerRepair/customerLoss/taskEntry/returnInfo/returnSales',
          params: {
            getdata: this.getdata
          }
        }
      ];
    },
    saveDialog() { },
    closeDialog() {
      this.$emit('close', false);
    }
  }
};
</script>
<style lang="less" scoped></style>
